
package nc.itf.hrppl.pjapplication.pjappl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import nc.pub.billcode.vo.BillCodeContext;
import nc.vo.hrppl.pjapplication.AggPjapplVO;
import nc.vo.hrppl.pjapplication.PJApplHVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.SuperVO;

public interface  IPJApplHVOService{

	/**
	 * 项目申请的AGGVO查询操作
	 * 根据主键条件查询Agg数组
	 * @param pk主键
	 * @return 结果数组
	 */
	public AggPjapplVO[] listAggPjapplVOByPk(String... pks) throws BusinessException;
	
	/**
	 * 项目申请的AGGVO查询操作
	 * 根据主键条件查询Agg数组
	 * @param pk主键
	 * @return 结果数组
	 */
	public AggPjapplVO[] listAggPjapplVOByPk(boolean blazyLoad,String... pks) throws BusinessException;
	
	/**
	 * 项目申请的AGGVO查询操作
	 * 根据主键条件查询Agg对象
	 * @param pk 主键
	 * @return 结果对象
	 */
	public  AggPjapplVO findAggPjapplVOByPk(String pk) throws BusinessException;
	
	/**
	 * 项目申请的AGGVO查询操作
	 * 根据条件字符串查询Agg数组
	 * @param condition 主键
	 * @return 结果数组
	 */
	public  AggPjapplVO[] listAggPjapplVOByCondition(String condition) throws BusinessException;
	
	/**
	 * 项目申请的AGGVO查询操作
	 * 根据条件字符串查询Agg数组
	 * @param condition 条件
	 * @param orderPath 排序集合
	 * @return 结果数组
	 */
	public  AggPjapplVO[] listAggPjapplVOByCondition(String condition,String[] orderPath) throws BusinessException;
	
	/**
	 * 项目申请的主表VO查询操作
	 * 根据主键条件查询Agg数组
	 * @param pk主键
	 * @return 结果数组
	 */
	public PJApplHVO[] listPJApplHVOByPk(String...pks) throws BusinessException;
	
	/**
	 * 项目申请的主表VO查询操作
	 * 根据主键条件查询Agg对象
	 * @param pk 主键
	 * @return 结果对象
	 */
	public  PJApplHVO findPJApplHVOByPk(String pk) throws BusinessException;
	
	/**
	 * 项目申请的主表VO查询操作
	 * 根据条件字符串查询Agg数组
	 * @param condition 主键
	 * @return 结果数组
	 */
	public  PJApplHVO[] listPJApplHVOByCondition(String condition) throws BusinessException;
	/**
	 * 项目申请的主表VO查询操作
	 * 根据条件字符串查询Agg数组
	 * @param condition 主键
	 * @return 结果数组
	 */
	public  PJApplHVO[] listPJApplHVOByCondition(String condition,String[] orderPath) throws BusinessException;

	/**
	 * 项目申请的主表pk查询操作
	 * 根据条件字符串查询pk数组数组
	 * @param condition 查询方案+
	 * @return 结果数组
	 */
	public String[] listPJApplHVOPkByCond(String condition) throws BusinessException;
	
	/**
	 * 项目申请的主表pk查询操作
	 * 根据条件字符串查询pk数组数组
	 * @param condition 查询方案+
	 * @return 结果数组
	 */
	public String[] listPJApplHVOPkByCond(String condition,String[] orderPath) throws BusinessException;
	/**
	 * 给主实体vo设置默认值
	 * @param vo
	 */
	public void initDefaultData(PJApplHVO vo);
	
	
	/**
	 * 预新增操作项目申请数据
	 * @param userJson  新增时需要的扩展参数对象
	 */
	public AggPjapplVO preAddAggPjapplVO(Map<String,Object> userJson) throws BusinessException;
	
	public AggPjapplVO preAddAggPjapplVO(AggPjapplVO vo,Map<String,Object> userJson) throws BusinessException;
	 /**
	 * 预编辑操作项目申请数据
	 * @param userJson  新增时需要的扩展参数对象
	 */
	public AggPjapplVO preEditAggPjapplVO(String pk) throws BusinessException;
	
	 /**
	 * 复制操作项目申请数据
	 * 
	 */
	public AggPjapplVO copyAggPjapplVO(String pk) throws BusinessException;
	/**
	 * 保存操作项目申请数据
	 * @param vos 保存对象
	 * @return @
	 */
	public AggPjapplVO[] saveAggPjapplVO(AggPjapplVO vo) throws BusinessException;

	public AggPjapplVO[] saveAggPjapplVO(AggPjapplVO[] vos) throws BusinessException;
	
	
	/**
	 * 删除操作项目申请数据
	 * @param vos 删除对象
	 * @return @
	 */
	public AggPjapplVO[] deleteAggPjapplVOs(Map<String,String> tsMap) throws BusinessException;
	
	/**
	 * 加载树类型数据项目申请
	 * @param vos 对象
	 * @return @
	 */
	public <T> T[] loadTreeData(Class<T> clazz,Map<String,Object> userJson) throws BusinessException;

	/**
	 * 根据主表主键查询子表pks
	 * @param childClazz 子表class
	 * @param parentId 主表主键
	 * @return 子表pks
	 * @throws BusinessException
	 */
	String[] queryChildPksByParentId(Class childClazz, String parentId) throws BusinessException;

	/**
	 * 根据子表主键查询子表数据
	 * @param childClazz 子表class
	 * @param pks 子表
	 * @return 子表vos
	 * @throws BusinessException
	 */
	SuperVO[] queryChildVOByPks(Class childClazz, String[] pks) throws BusinessException;
	/**
	 * 单个提交
	 * @param actionName 动作脚本编码
	 * @param tsMap  key为主键  value为ts
	 * @param assign 指派信息，只有单个提交允许指派
	 * @return Object
	 * @throws BusinessException
	 */
	public Object commitAggPjapplVO(String actionName,Map<String,String> tsMap,Object assign) throws BusinessException;
	/**
	 * 批量提交
	 * @param actionName 动作脚本编码
	 * @param tsMap  key为主键  value为ts
	 * @throws BusinessException
	 */
	public Object batchCommitAggPjapplVO(String actionName,Map<String,String> tsMap) throws BusinessException;
	/**
	 * 单个收回
	 * @param actionName 动作脚本编码
	 * @param tsMap  key为主键  value为ts
	 * @return
	 * @throws BusinessException
	 */
	public Object uncommitAggPjapplVO(String actionName,Map<String,String> tsMap) throws BusinessException;
	/**
	 * 批量收回
	 * @param actionName 动作脚本编码
	 * @param tsMap  key为主键  value为ts
	 * @throws BusinessException
	 */
	public Object batchUncommitAggPjapplVO(String actionName,Map<String,String> tsMap) throws BusinessException;
	/**
	 * SAVEBASE 回调--动作脚本处调用
	 * @param vos
	 * @throws BusinessException
	 * @return
	 */
	public AggPjapplVO[] callbackSAVEBASE(AggPjapplVO...vos) throws BusinessException;
	
	/**
	 * SAVE 回调--动作脚本处调用
	 * @param vos
	 * @throws BusinessException
	 * @return
	 */
	public AggPjapplVO[] callbackSAVE(AggPjapplVO...vos) throws BusinessException;
	
	/**
	 * UNSAVE 回调--动作脚本处调用
	 * @param vos
	 * @throws BusinessException
	 * @return
	 */
	public AggPjapplVO[] callbackUNSAVE(AggPjapplVO...vos) throws BusinessException;
	
	/**
	 * APPROVE 回调--动作脚本处调用
	 * @param vos
	 * @throws BusinessException
	 * @return
	 */
	public AggPjapplVO[] callbackAPPROVE(AggPjapplVO...vos) throws BusinessException;
	
	/**
	 * UNAPPROVE 回调--动作脚本处调用
	 * @param vos
	 * @throws BusinessException
	 * @return
	 */
	public AggPjapplVO[] callbackUNAPPROVE(AggPjapplVO...vos) throws BusinessException;
	
	/**
	 * 获取默认(全局)编码规则上下文
	 * 
	 * @param coderuleid 编码规则主键?
	 * @return 编码规则上下文
	 * @throws BusinessException
	 */
	public BillCodeContext getBillCodeContext(String coderuleid) throws BusinessException;

	/**
	 * 获取编码规则上下文
	 * 
	 * @param coderuleid
	 * @param pkgroup
	 * @param pkorg
	 * @return
	 * @throws BusinessException
	 */
	public BillCodeContext getBillCodeContext(String coderuleid, String pkgroup, String pkorg) throws BusinessException;
	
	/**
	 * 项目库准入
	 * @param clientFullVOs
	 * @return
	 * @throws BusinessException
	 */
	public AggPjapplVO[] warehousing(AggPjapplVO[] clientFullVOs) throws BusinessException ;
	/**
	 * 项目库准入
	 * @param clientFullVOs
	 * @return
	 * @throws BusinessException
	 */
	public AggPjapplVO warehousing(String pk) throws BusinessException ;
	
	/**
	 * 项目库退库
	 * @param clientFullVOs
	 * @return
	 * @throws BusinessException
	 */
	public AggPjapplVO unwarehousing(String pk) throws BusinessException ;
	
	
	/**
	 * 项目库结项
	 * @param clientFullVOs
	 * @return
	 * @throws BusinessException
	 */
	public AggPjapplVO closinitem(String pk) throws BusinessException ;
	
	
	/**
	 * 项目库取消结项
	 * @param clientFullVOs
	 * @return
	 * @throws BusinessException
	 */
	public AggPjapplVO unClosinitem(String pk) throws BusinessException ;
	
	
	
	/**
	 * 项目库退库
	 * @param clientFullVOs
	 * @return
	 * @throws BusinessException
	 */
	public  AggPjapplVO[] unwarehousing(AggPjapplVO[] clientFullVOs) throws BusinessException;
	
	/**
	 * pk   项目申请单主键
	 * pjstatus 项目库状态    未启用 1 ,启用 2,停用 3 ,结项
	 * @return
	 * @throws BusinessException
	 */
	public void updateCategory(String pk ,int pjstatus) throws BusinessException ;
	
	/**
	 * 预算余额查询
	 * @param var1
	 * @param var2
	 * @param var3
	 * @return
	 * @throws BusinessException
	 */
	public HashMap<String, Object> getBalanValue(String pk_project, String nyear, int srctype) throws BusinessException ;

	public void createHistory(String historyyear, ArrayList<String> pks) throws BusinessException ;

	// begin modify by wy at 2025年1月13日 增加 项目退库、结项、取消结账 增加备注

	/**
	 * 项目库取消结项 -- 增加备注
	 * @param pk
	 * @param bz
	 * @return
	 * @throws BusinessException
	 */
	public AggPjapplVO unClosinitem(String pk, String bz) throws BusinessException ;


	/**
	 * 项目库退库 -> 增加退库哭说明
	 * @param pk
	 * @param bz
	 * @return
	 * @throws BusinessException
	 */
	public AggPjapplVO unwarehousing(String pk, String bz) throws BusinessException ;


	/**
	 * 项目库结项 -> 增加原因说明
	 * @param pk
	 * @param bz
	 * @return
	 * @throws BusinessException
	 */
	public AggPjapplVO closinitem(String pk, String bz) throws BusinessException ;
	// end modify by wy
}